'use strict';
import * as Koa from 'koa';
import { router, prefix } from '../middleware/router';
import { response } from '../middleware/result';
import { usergamehistoryService } from '../service/usergamehistory';
import { logService } from '../service/log';

/** 首页轮播api对象 */
@prefix('usergame')
class usergamehistoryController {
    @router('/query', { method: 'post' })
    async query(ctx: Koa.Context) {
        // 记录回调日志
        logService.createlogger(ctx, 0);
        let result = await usergamehistoryService.query(ctx.request.body);
        response(ctx, result);
    }
    @router('/save', { method: 'post' })
    async save(ctx: Koa.Context) {
        // 记录回调日志
        logService.createlogger(ctx, 0);
        let result = await usergamehistoryService.save(ctx.request.body);
        response(ctx, result);
    }
    @router('/getgift')
    async getgift(ctx: Koa.Context) {
        // 记录回调日志
        logService.createlogger(ctx, 0);
        let result = await usergamehistoryService.getgift(ctx.query.id);
        response(ctx, result);
    }
}